import request from '@/common/request.js'
import { formatGetUri } from '@/common/util.js'

const api = {}
//注册
api.register = params => request.globalRequest(`/mobile/signUp`, 'POST', params, 1)
//授权登录
api.loginCode = params => request.globalRequest(`/loginCode`, 'POST', params, 1)
api.loginCodeByToutiao = params => request.globalRequest(`/loginCodeByToutiao`, 'POST', params, 1)
api.phone = params => request.globalRequest(`/phone`, 'POST', params, 1)
api.phoneByToutiao = params => request.globalRequest(`/phoneByToutiao`, 'POST', params, 1)

//获取区域
api.getRegions= params => request.globalRequest(`/getRegions`, 'GET', params, 1)
//请求
api.post= params => request.globalRequest(`/post`, 'GET', params, 1)
//slider
api.slider= params => request.globalRequest(`/slider`, 'GET', params, 1)
//sliderV1
api.sliderV1= params => request.globalRequest(`/sliderV1`, 'GET', params, 1)
//获取default区域
api.getDefaultRegions=params=> request.globalRequest(`/getDefaultRegions`, 'GET', params, 1)

//保存用户需求
api.saveUserNeeds=params=> request.globalRequest(`/saveUserNeeds`, 'POST', params, 5)
//保存园区用户需求
api.saveUserParkNeeds=params=> request.globalRequest(`/saveUserParkNeeds`, 'POST', params, 5)
//厂房列表
api.getFactorys=params=> request.globalRequest(`/getFactorys`, 'GET', params, 1)

//园区详情
api.getFactoryDetail=params=> request.globalRequest(`/getFactoryDetail`, 'GET', params, 5)

//获取喜欢的厂房
api.getFactorysLike=params=> request.globalRequest(`/getFactorysLike`, 'GET', params, 1)
//获取筛选的区域
api.getFactorysCondition=params=> request.globalRequest(`/getFactorysCondition`, 'GET', params, 1)
api.getFactorysCondition1=params=> request.globalRequest(`/getFactorysCondition1`, 'GET', params, 1)
api.getFactorysConditionV2=params=> request.globalRequest(`/getFactorysCondition/v2`, 'GET', params, 1)
//买房攻略
api.getNewsCondition=params=> request.globalRequest(`/getNewsCondition`, 'GET', params, 1)
//新闻
api.getNews=params=> request.globalRequest(`/getNews`, 'GET', params, 1)
api.getNewsRecommend=params=> request.globalRequest(`/getNewsRecommend`, 'GET', params, 1)
api.getNewsDetail=params=> request.globalRequest(`/getNewsDetail`, 'GET', params, 5)
//登录
api.login=params=> request.globalRequest(`/login`, 'POST', params, 1)
api.me=params=> request.globalRequest(`/me`, 'GET', params, 5)
//收藏厂房
api.likeFactory=params=> request.globalRequest(`/likeFactory`, 'POST', params, 5)

//收藏浏览记录
api.getUserRecords=params=> request.globalRequest(`/getUserRecords`, 'GET', params, 5)
//发送验证码
api.sendVerifyCode=params=> request.globalRequest(`/sendVerifyCode`, 'POST', params, 1)
//是否收藏 
api.isLikeFactory=params=> request.globalRequest(`/isLikeFactory`, 'POST', params, 5)
//最新成交
api.newChengjiao=params=> request.globalRequest(`/newChengjiao`, 'GET', params, 1)
api.toutiao=params=> request.globalRequest(`/toutiao`, 'GET', params, 1)
//区域选房

api.RegionPark=params=> request.globalRequest(`/regions/park`, 'GET', params, 1)
api.parkDetail=params=> request.globalRequest(`/parkDetail`, 'GET', params, 1)

api.hotRegions=params=> request.globalRequest(`/hotRegions`, 'GET', params, 1)
api.hotRegions1=params=> request.globalRequest(`/hotRegions1`, 'GET', params, 1)
//城市均价
api.index=params=> request.globalRequest(`/index`, 'GET', params, 1)
//城市行情 
api.month=params=> request.globalRequest(`/month`, 'GET', params, 1)
//热门园区
api.hotPark=params=> request.globalRequest(`/hotPark`, 'GET', params, 1)
api.parks=params=> request.globalRequest(`/parks`, 'GET', params, 1)
export default api